import request from "@/utils/request.js";

export function createProjectApi(data) {
    return request({
        url: '/project/save',
        headers: {
            isToken: true
        },
        method: 'post',
        data: data
    })
}

export function joinProjectApi(data) {
    return request({
        url: '/project/join',
        headers: {
            isToken: true
        },
        method: 'post',
        data: data
    })
}
    export function getList(data) {
        return request({
            url: '/project/get',
            headers: {
                isToken: true
            },
            method: 'post',
            data: data
        })
}

export function getListById(id) {
    return request({
        url: '/project/get',
        headers: {
            isToken: true
        },
        method: 'post',
        data: {
            id: id
        }
    })
}
export function top(data) {
    return request({
        url: '/project/top',
        headers: {
            isToken: true
        },
        method: 'get',
        params: data
    })
}

export function collection(data) {
    return request({
        url: '/project/collection',
        headers: {
            isToken: true
        },
        method: 'get',
        params: data
    })
}
export function getListCreate(data) {
    return request({
        url: '/project/getCreate',
        headers: {
            isToken: true
        },
        method: 'post',
        data: data
    })
}

export function getListJoin(data) {
    return request({
        url: '/project/getJoin',
        headers: {
            isToken: true
        },
        method: 'post',
        data: data
    })
}

export function update(data) {
    return request({
        url: '/project/update',
        headers: {
            isToken: true
        },
        method: 'put',
        data: data
    })
}

export function remove(id) {
    return request({
        url: '/project/remove/' + id,
        headers: {
            isToken: true
        },
        method: 'delete'
    })
}